package com.cskaoyan.service;

import com.cskaoyan.bean.User;
import com.cskaoyan.mapper.UserMapper;
import com.cskaoyan.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @author stone
 * @date 2022/11/12 14:35
 */
public class UserServiceImpl implements UserService{

    @Override
    public void insertUser(User user) {
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
        userMapper.insert(user);
        sqlSession.commit();
        sqlSession.close();
    }
}
